function gi3dEvent(n,t){var i=document.createEvent("Event");i.initEvent(n,!0,!0);i.data=t;document.dispatchEvent(i)}function gi3dDebug(){typeof gi3d_debug_mode!="undefined"&&window.gi3d_debug_mode===!0&&console.debug("??",[].slice.call(arguments).join(" "))}function gi3dInit(){"use strict";function u(){i.one("load",function(){f()}).each(function(){this.complete&&$(this).load()})}function f(){if(ni?Math.floor(t-i):0;setTimeout(function(){gi3dDebug("openEnvelope()",n,"loadingRemainder (ms)",u);$(".layout").addClass("layout--is-ready");setTimeout(function(){$(".loading").addClass("loading--is-loaded");$(".envelope").addClass("envelope--is-shown")},2e3);setTimeout(function(){$(".layout").addClass("overflow--visible");$(".envelope").removeClass("envelope--is-shown");$(".envelope").addClass("envelope--is-opening")},4e3);setTimeout(function(){$(".envelope").removeClass("envelope--is-opening");$(".envelope").addClass("envelope--is-opened")},5100);setTimeout(function(){e()},7e3)},u)}function e(){gi3dEvent("gi3d-card-ready")}gi3dDebug("envelope.js was loaded");var t=4e3,o=window.performance.now(),i=$("img.preload"),r=i.length,n=1;gi3dDebug(r,"total preloaded images");u();$("#rerun-toggle").click(function(){$(".loading").removeClass("is-loaded");$(".layout").removeClass("layout--is-ready overflow--visible");$(".envelope").removeClass("envelope--is-shown");$(".envelope").removeClass("envelope--is-opening");$(".envelope").removeClass("envelope--is-opened");$(".card").removeClass("is-gesture-enabled").removeClass(removeAllFrameClasses);n=1;u()})}function removeAllFrameClasses(){return this.className.split(" ").filter(function(n){return n.match(/frame-\d{1,3}/)}).join(" ")}(function(n,t,i,r){"use strict";function ci(n,t,i){return setTimeout(ai(n,i),t)}function ut(n,t,i){return Array.isArray(n)?(v(n,i[t],i),!0):!1}function v(n,t,i){var u;if(n)if(n.forEach)n.forEach(t,i);else if(n.length!==r)for(u=0;u\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=n.console&&(n.console.warn||n.console.log);return r&&r.call(n.console,u,f),t.apply(this,arguments)}}function o(n,t,i){var u=t.prototype,r;r=n.prototype=Object.create(u);r.constructor=n;r._super=u;i&&y(r,i)}function ai(n,t){return function(){return n.apply(t,arguments)}}function vi(n,t){return typeof n==bu?n.apply(t?t[0]||r:r,t):n}function hr(n,t){return n===r?t:n}function pt(n,t,i){v(bt(t),function(t){n.addEventListener(t,i,!1)})}function wt(n,t,i){v(bt(t),function(t){n.removeEventListener(t,i,!1)})}function cr(n,t){while(n){if(n==t)return!0;n=n.parentNode}return!1}function g(n,t){return n.indexOf(t)>-1}function bt(n){return n.trim().split(/\s+/g)}function ft(n,t,i){if(n.indexOf&&!i)return n.indexOf(t);for(var r=0;ri[t]}):u.sort()),u}function dt(n,t){for(var i,u,e=t[0].toUpperCase()+t.slice(1),f=0;f1&&!i.firstMultiple?i.firstMultiple=br(t):o===1&&(i.firstMultiple=!1);var s=i.firstInput,u=i.firstMultiple,h=u?u.center:s.center,c=t.center=kr(f);t.timeStamp=hi();t.deltaTime=t.timeStamp-s.timeStamp;t.angle=pi(h,c);t.distance=ti(h,c);ff(i,t);t.offsetDirection=gr(t.deltaX,t.deltaY);r=dr(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=r.x;t.overallVelocityY=r.y;t.overallVelocity=d(r.x)>d(r.y)?r.x:r.y;t.scale=u?sf(u.pointers,f):1;t.rotation=u?of(u.pointers,f):0;t.maxPointers=i.prevInput?t.pointers.length>i.prevInput.maxPointers?t.pointers.length:i.prevInput.maxPointers:t.pointers.length;ef(i,t);e=n.element;cr(t.srcEvent.target,e)&&(e=t.srcEvent.target);t.target=e}function ff(n,t){var i=t.center,r=n.offsetDelta||{},e=n.prevDelta||{},o=n.prevInput||{};(t.eventType===f||o.eventType===u)&&(e=n.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=n.offsetDelta={x:i.x,y:i.y});t.deltaX=e.x+(i.x-r.x);t.deltaY=e.y+(i.y-r.y)}function ef(n,t){var i=n.lastInterval||t,c=t.timeStamp-i.timeStamp,f,o,s,h;if(t.eventType!=e&&(c>nf||i.velocity===r)){var l=t.deltaX-i.deltaX,a=t.deltaY-i.deltaY,u=dr(c,l,a);o=u.x;s=u.y;f=d(u.x)>d(u.y)?u.x:u.y;h=gr(l,a);n.lastInterval=t}else f=i.velocity,o=i.velocityX,s=i.velocityY,h=i.direction;t.velocity=f;t.velocityX=o;t.velocityY=s;t.direction=h}function br(n){for(var i=[],t=0;t=d(t)?n<0?st:ht:t<0?ct:lt}function ti(n,t,i){i||(i=wr);var r=t[i[0]]-n[i[0]],u=t[i[1]]-n[i[1]];return Math.sqrt(r*r+u*u)}function pi(n,t,i){i||(i=wr);var r=t[i[0]]-n[i[0]],u=t[i[1]]-n[i[1]];return Math.atan2(u,r)*180/Math.PI}function of(n,t){return pi(t[1],t[0],ni)+pi(n[1],n[0],ni)}function sf(n,t){return ti(t[0],t[1],ni)/ti(n[0],n[1],ni)}function ii(){this.evEl=cf;this.evWin=lf;this.pressed=!1;s.apply(this,arguments)}function wi(){this.evEl=nu;this.evWin=tu;s.apply(this,arguments);this.store=this.manager.session.pointerEvents=[]}function iu(){this.evTarget=pf;this.evWin=wf;this.started=!1;s.apply(this,arguments)}function bf(n,t){var i=kt(n.touches),r=kt(n.changedTouches);return t&(u|e)&&(i=lr(i.concat(r),"identifier",!0)),[i,r]}function ri(){this.evTarget=uu;this.targetIds={};s.apply(this,arguments)}function kf(n,t){var r=kt(n.touches),o=this.targetIds;if(t&(f|nt)&&r.length===1)return o[r[0].identifier]=!0,[r,r];var i,s,h=kt(n.changedTouches),c=[],l=this.target;if(s=r.filter(function(n){return cr(n.target,l)}),t===f)for(i=0;i-1&&r.splice(n,1)},setTimeout(u,fu))}function gf(n){for(var r=n.srcEvent.clientX,u=n.srcEvent.clientY,t=0;t-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(n){return!!this.simultaneous[n.id]},emit:function(n){function r(i){t.manager.emit(i,n)}var t=this,i=this.state;i=k&&r(t.options.event+lu(i))},tryEmit:function(n){if(this.canEmit())return this.emit(n);this.state=a},canEmit:function(){for(var n=0;ni.threshold&&t&i.direction},attrTest:function(n){return c.prototype.attrTest.call(this,n)&&(this.state&h||!(this.state&h)&&this.directionTest(n))},emit:function(n){this.pX=n.deltaX;this.pY=n.deltaY;var t=au(n.direction);t&&(n.additionalEvent=this.options.event+t);this._super.emit.call(this,n)}});o(nr,c,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[it]},attrTest:function(n){return this._super.attrTest.call(this,n)&&(Math.abs(n.scale-1)>this.options.threshold||this.state&h)},emit:function(n){if(n.scale!==1){var t=n.scale<1?"in":"out";n.additionalEvent=this.options.event+t}this._super.emit.call(this,n)}});o(tr,w,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[cu]},process:function(n){var t=this.options,i=n.pointers.length===t.pointers,r=n.distancet.time;if(this._input=n,!r||!i||n.eventType&(u|e)&&!o)this.reset();else if(n.eventType&f)this.reset(),this._timer=ci(function(){this.state=p;this.tryEmit()},t.time,this);else if(n.eventType&u)return p;return a},reset:function(){clearTimeout(this._timer)},emit:function(n){this.state===p&&(n&&n.eventType&u?this.manager.emit(this.options.event+"up",n):(this._input.timeStamp=hi(),this.manager.emit(this.options.event,this._input)))}});o(ir,c,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[it]},attrTest:function(n){return this._super.attrTest.call(this,n)&&(Math.abs(n.rotation)>this.options.threshold||this.state&h)}});o(rr,c,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:l|tt,pointers:1},getTouchAction:function(){return oi.prototype.getTouchAction.call(this)},attrTest:function(n){var t=this.options.direction,i;return t&(l|tt)?i=n.overallVelocity:t&l?i=n.overallVelocityX:t&tt&&(i=n.overallVelocityY),this._super.attrTest.call(this,n)&&t&n.offsetDirection&&n.distance>this.options.threshold&&n.maxPointers==this.options.pointers&&d(i)>this.options.velocity&&n.eventType&u},emit:function(n){var t=au(n.offsetDirection);t&&this.manager.emit(this.options.event+t,n);this.manager.emit(this.options.event,n)}});o(si,w,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[di]},process:function(n){var t=this.options,o=n.pointers.length===t.pointers,s=n.distances?s:r,e!==r)e=r,h=i;else return;gi3dDebug(t.type,"deltaSize",f,"deltaStep",i,"oldDeltaStep",h,"initFrame",c,"oldFrame",e,"currentFrame",r);window.requestAnimationFrame(function(){n(".card").removeClass(removeAllFrameClasses).addClass("frame-"+r)})}}function b(){var n=5;if(p){gi3dDebug("Hammer.Tap callback ignored because we are currently tweening");return}if(r>=u[2]-n){gi3dDebug("Hammer.Tap","currentFrame",r,"endFrame",0);y(0);return}if(r>=u[1]-n&&r=u[0]-n&&rr?"increasing":"decreasing";gi3dDebug("framesPerStep",u,"tweenDirection",f);k=setInterval(function(){p=!0;f==="increasing"&&r>=t||f==="decreasing"&&r<=t?d():(f==="increasing"&&r>=t-u||f==="decreasing"&&r<=t+u)&&(u=1);window.requestAnimationFrame(function(){n(".card").removeClass(removeAllFrameClasses).addClass("frame-"+r);e=r;f==="increasing"?r+=u:r-=u})},17)}function d(){clearInterval(k);p=!1}var g=i.originalEvent.data;gi3dDebug("gi3d-card-ready — gestureData:",g||"none");n(".card").addClass("is-gesture-enabled");var s=Number(window.getComputedStyle(document.querySelector(".layout"),"::after").getPropertyValue("content").replace(..\\index.html"/g,"").replace(..\\index.html'/g,"").split("||")[0]),f=window.getComputedStyle(document.querySelector(".layout"),"::after").getPropertyValue("content").replace(..\\index.html"/g,"").replace(..\\index.html'/g,"").split("||")[1].split("|"),u=[Number(f[0]),Number(f[0])+Number(f[1]),Number(f[0])+Number(f[1])+Number(f[2]),];gi3dDebug("?? NUM_FRAMES:",s,"FRAME_COUNTS:",f,"keyframes:",u);var c=1,r=1,e=0,h=0,nt=5/3,k,p=!1,o=n(".layout"),l=new t(o[0]),tt=n(".drag"),a=new t(tt[0]),it=n(".dragMob"),v=new t(it[0]);l.add(new t.Pan({direction:t.DIRECTION_ALL,threshold:0}));a.add(new t.Pan({direction:t.DIRECTION_ALL,threshold:0}));v.add(new t.Pan({direction:t.DIRECTION_ALL,threshold:0}));l.on("panstart panmove",w);a.on("panstart panmove",w);v.on("panstart panmove",w);l.add(new t.Tap({}));a.add(new t.Tap({}));v.add(new t.Tap({}));l.on("tap",b);a.on("tap",b);v.on("tap",b)})}(jQuery,Hammer)